package ru.ipccenter.jshell.frontend.compiler;

import javax.tools.SimpleJavaFileObject;
import java.net.URI;


public class MemorySource extends SimpleJavaFileObject {
  
  private final String content;

  
  protected MemorySource(String name, Kind kind, String content) {
    
    super(URI.create("memo:///" + name.replace('.', '/') + kind.extension), kind);
    this.content = content;
  }
  
  @Override
  public CharSequence getCharContent(boolean ignore) {
    
    return this.content;
  }
}
